﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TeacherHelp.FormList.Student
{
    public partial class TestResult : Form
    {
        private TestResult()
        {
            InitializeComponent();
        }
        public TestResult(List<ViewModel.TestExercises> testExercise, DateTime? startTime = null, DateTime? endTime = null, int? subjectId = null) : this()
        {
            BLL.TestManager testManager = new BLL.TestManager();
            int testId = -1;//考试Id

            double score = 0;

            score = testManager.TestSubmit(testExercise, Program.UserId, subjectId, ref testId, startTime, endTime, 100);


            //进度条的显示
            progressBar1.Value = score.ToInt();

            scoreLabel.Text = score.ToInt() + " 分";

            if (testId != -1)
            {
                //生成考试详情HTML页面
                testManager.BuilderTestInfoHTML(testId.ToString());
            }

        }
    }
}
